#!/bin/sh
VERSION=$1
if [[ ! -n $VERSION ]]; then
	echo '第一个参数版本号空'
	exit
fi
BACK_PATH=$(dirname "$PWD")
cd ${BACK_PATH}
mvn clean package -Dmaven.test.skip=true
cp ${BACK_PATH}/target/inspector_cn.jar ${BACK_PATH}/docker/app.jar
cd ${BACK_PATH}/docker
docker build -t registry.cn-shanghai.aliyuncs.com/openvidu_cn/inspector_cn:$VERSION .
docker push registry.cn-shanghai.aliyuncs.com/openvidu_cn/inspector_cn:$VERSION
rm ${BACK_PATH}/docker/app.jar
